home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zoom 2
/
Zoom - Release 2 (1996)(Active Software)[!].iso
/
misc
/
scion409
/
scionarexx.lha
/
Help.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-06-28
|
4KB
|
122 lines
/****************************************************************************
* *
* $VER: Help 1.12 (12 Jun 1995)
* *
* Written by Freddy Ariës, with modifications by Robbie Akins *
* *
* Just a simple menu, for those who can't remember under which function *
* key they have stored a certain function. *
* *
* This script will output a requester on the Scion window, in which it *
* will display the current settings of Scion's function keys. *
* It requires a version of Scion Genealogist >= 4.04, as well as *
* rexxreqtools.library, which in turn needs reqtools.library (>=2.0) *
* and rexxsyslib.library. *
* *
* For this script to be of any use to you, you will have to add the *
* Help.rexx command to the list of function keys that you have set in *
* the ScionPrefs program (eg. under F1 or F10). *
* *
* 1 June 1995: added "stripstring" option, and handling of long results *
* - Robbie Akins *
* *
****************************************************************************/
options results
NL = '0A'x
PSCR = 'SCIONGEN'; /* public screen to open the requesters on */
versionstr = "1.12"
/* stripstring: 1 = strip directory path from string, 0 = don't strip */
stripstring.1 = 0
stripstring.2 = 0
stripstring.3 = 0
stripstring.4 = 0
stripstring.5 = 0
stripstring.6 = 0
stripstring.7 = 0
stripstring.8 = 0
stripstring.9 = 0
stripstring.10 = 0
if ~show('l','rexxreqtools.library') then do
if exists('libs:rexxreqtools.library') then
call addlib('rexxreqtools.library',0,-30,0)
else do
say "Unable to open rexxreqtools.library"
exit
end
end
/* These few lines were stolen from Peter Billings - thanks Peter ;-) */
if ~show('P','SCIONGEN') then do
TermError('I am sorry to say that the SCION Genealogist' || NL ||,
'database is not available. Please start the' || NL ||,
'SCION program BEFORE using this script!')
end
myport = "SCIONGEN"
address value myport
/*
* Now let's get funky... (get the current function key settings) ;-)
*/
do i=1 to 10
GETFUNKEY i
fun.i = TruncString(StripPath(RESULT, i))
end
rtn = rtezrequest('Current Scion Function Keys: '||NL||,
NL||' F1 = '||fun.1||,
NL||' F2 = '||fun.2||,
NL||' F3 = '||fun.3||,
NL||' F4 = '||fun.4||,
NL||' F5 = '||fun.5||,
NL||' F6 = '||fun.6||,
NL||' F7 = '||fun.7||,
NL||' F8 = '||fun.8||,
NL||' F9 = '||fun.9||,
NL||' F10 = '||fun.10||,
'','_Ok','Help v'||versionstr||' by F.Ariës & R.Akins','rt_pubscrname = '||PSCR)
EXIT
TermError:
parse arg str
rtezrequest(str,'E_xit','Help Message:','rt_pubscrname = '||PSCR)
EXIT
/*
* Procedure to strip the directory path from the string.
* It will cut off the entire left part of the string, until (and including)
* the path name, only leaving the filename.
* If you don't want the path to be left off, use the stripstring flags
*/
StripPath: PROCEDURE EXPOSE stripstring.
parse arg str, ix
if stripstring.ix then /* test by Robbie Akins */
do
p = lastpos('/', str)
if p > 0 then ret1 = delstr(str,1,p)
else ret1 = str
p = lastpos(':', ret1)
if p > 0 then retstr = delstr(ret1,1,p)
else retstr = ret1
end
else
retstr = str
return retstr
/*
* Procedure to truncate long strings and add ellipsis (...) at the end
* Written by Robbie Akins
*/
TruncString: PROCEDURE
parse arg trstr
if length(trstr) > 60 then
rtnstr = trim(left(trstr, 60))||"..."
else
rtnstr = trstr
return rtnstr